﻿using System;
using System.Web;
using System.Web.WebPages;

namespace MyExtenstionMethods{

	public static class Utility{


	    // make the page to render optional
		public static dynamic RenderOptionalPage(this WebPage Webpage ,string page="",params object[] data){

            try{
				return Webpage.RenderPage(page,data);
              
            }catch(HttpException ex){
                return new HtmlString("<!-- page not found -->");
            }//ArgumentException
          
        
    	}	
	}
}